/** @format */

import { useUserService } from './useUserService'

const handleBack = () => {
  uni.navigateBack({})
}

const handleBackHome = () => {
  const { userConf } = useUserService()
  const { homePath } = userConf.value

  uni.reLaunch({ url: homePath || '/pages/index/index' })
}

export const useNavHome = () => {
  return {
    handleBack,
    handleBackHome,
  }
}
